Release 10.1A: OpenEdge Data Management:
SQL Development
Using the SQLDUMP utility
The
SQLDUMPutility is a command-line utility that dumps application data from SQL tables into one or more files. You can load the data from the files into another database with theSQLLOADutility. TheSQLDUMPutility does not dump data from Progress 4GL tables. The utility is available for only those tables that were created with SQL.The
SQLDUMPutility has the following syntax:
The
SQLDUMPutility writes user data in row order into ASCII records with variable-length format. The column order in the files is identical to the column order in the tables. The utility writes both format and content header records to the dump file. You can dump multiple tables in a single execution by specifying multiple table names, separated by commas. Make sure there are no spaces before or after commas in the table list.Data for one table always goes to a single dump file. Each dump file corresponds to one database table. For example, if you specify 200 tables in the
SQLDUMPcommand, you will create 200 dump files. TheSQLDUMPutility assigns the filenames that correspond to the owner_name and table_name in the database, with the file extension.dsql. If a dump file for a specified table already exists, it will be overwritten and replaced. Dump files are created in the current working directory.The format of each record in a dump file is similar to the Progress 4GL
.dfile format:
- Converts all values to character representation.
- Delimits
CHARACTERvalues with double quotes.- Can contain any embedded characters except
NULLvalues, allowing commas, new lines, and other control characters.- Uses two sets of double quotes to escape embedded double quotes.
- Delimits
NUMERICand other noncharacter data types using a space.- Processes
TIMESTAMPdata as if it wereCHARACTERdata.- Has a size limit of 2K for a single column value.
- Has a maximum record length
of32K for dump file records.Any error is a fatal error, and
SQLDUMPhalts the dumping process so that data integrity will not be compromised.SQLDUMPreports errors to standard output.After successful processing,
SQLDUMPwrites a summary report to standard output. For each tableSQLDUMPprocesses, the report shows:Example 5–26 directs the
SQLDUMPutility to write the data from two tables to two dump files. The user_name and password for connecting to the database aretuckerandsulky. Thetuckeraccount must have the authority to access the customers and products tables in databasesalesdbwith owner_name martin.
Example 5–27 directs the
SQLDUMPutility to write the data from all tables in thesalesdbdatabase that begin with any of these strings:cust,invent, andsales, and having any owner name that the usertuckerhas authority to access. The user_name and password for connecting to the database aretuckerandsulky.
Example 5–28 directs the
SQLDUMPutility to write the data from all tables for all owner names in thesalesdbdatabase.
Notes: The database_name must be the last parameter given. Each dump file records character set information in the identifier section of each file.
Example 5–29 depicts a dump file.
The character set recorded in the dump file is the client character set. The default character set for all non-JDBC clients is taken from the local operating system through the operating system APIs. JDBC clients use the Unicode UTF-8 character set.
To use a character set different than that used by the operating system, set the
SQL_CLIENT_CHARSETenvironment variable to the name of the preferred character set. You can define any Progress 4GL-supported character set name. The name is not case-sensitive.
SQLDUMPdoes not support the following characters in schema names:
SQLDUMP, however, does support schema names that contain special characters such as a blank space, a hyphen (-), or a pound sign (#). These names must be used as delimited identifiers. Therefore, when specifying names with special characters on a UNIX command line, follow these rules:
- Use double quotes to delimit identifiers.
- So that the command line does not strip the quotes, use a backslash (\) to escape the double quotes used for delimited identifiers.
- Use double quotes to enclose any names with embedded spaces, commas, or characters special to a command shell (such as the Bourne shell). This use of quotes is in addition to quoting delimited identifiers.
For example, to dump the table
Yearly Profits, use the following UNIX command-line syntax:
In Windows, the command interpreter rules for the use of double quotation marks varies from UNIX.
By default,
SQLDUMPdisplayspromsgsmessages using the code page corresponding to code-page-name. That is, if you are dumping a Russian database, and code-page-name specifies the name of a Russian code page, the client displayspromsgsmessages using the Russian code page (unless you specify a different code page by setting the client’sSQL_CLIENT_CHARSET_PROMSGSenvironment variable).
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |